﻿<MItemGroup Mandatory Class="@($"m-color-group d-flex { (SpaceBetween?"justify-space-between":"") } mx-n1 {@Class}")" style="@Style">
    @foreach (var color in Colors)
    {
        <MItem>
            <MCard Class="elevation-0" Style="@($"transition: opacity .4s ease-in-out; {(context.Active ? "" : "opacity: 0.5;")}")">
                <SButton OnClickStopPropagation Fab BorderRadiusClass="rounded-circle" Class="mx-1" OnClick="()=>{ context.Toggle(); ValueChanged.InvokeAsync(color); }"
                     Width=Size Height=Size MinWidth=Size MinHeight=Size Color="@color">
                </SButton>
            </MCard>
            @if (ItemAppendContent is not null)
            {
                <div class="m-color-item-append d-flex align-center mr-1">
                    @ItemAppendContent(color)
                </div>
            }
        </MItem>
    }
</MItemGroup>